<tr>
{% if account_linked %}
    {% if from_account %}
        <td>
            <a href="{% url account_payment_details account_id=payment.from_account.id payment_id=payment.id %}">{{payment.expiration_date}}</a>
        </td>
        <td class="payment_to">
            <a href="{% url account_payment_details account_id=payment.from_account.id payment_id=payment.id %}">{{payment.to_account.user.get_full_name}}</a>
        </td>
        <td class="money">
            <a href="{% url account_payment_details account_id=payment.from_account.id payment_id=payment.id %}">-{{payment.amount}} €</a>
        </td>
    {% else %}
        <td>
            <a href="{% url account_payment_details account_id=payment.to_account.id payment_id=payment.id %}">{{payment.expiration_date}}</a>
        </td>
        <td class="payment_from">
            <a href="{% url account_payment_details account_id=payment.to_account.id payment_id=payment.id %}">{{payment.from_account.user.get_full_name}}</a>
        </td>
        <td class="money">
            <a href="{% url account_payment_details account_id=payment.to_account.id payment_id=payment.id %}">+{{payment.amount}} €</a>
        </td>
    {% endif %}
{% else %}
    {% if from_account %}
        <td>
            <a href="{% url payment_details payment_id=payment.id %}">{{payment.expiration_date}}</a>
        </td>
        <td class="payment_to">
            <a href="{% url payment_details payment_id=payment.id %}">{{payment.to_account.user.get_full_name}}</a>
        </td>
        <td class="money">
            <a href="{% url payment_details payment_id=payment.id %}">-{{payment.amount}} €</a>
        </td>
    {% else %}
        <td>
            <a href="{% url payment_details payment_id=payment.id %}">{{payment.expiration_date}}</a>
        </td>
        <td class="payment_from">
            <a href="{% url payment_details payment_id=payment.id %}">{{payment.from_account.user.get_full_name}}</a>
        </td>
        <td class="money">
            <a href="{% url payment_details payment_id=payment.id %}">+{{payment.amount}} €</a>
        </td>
    {% endif %}
{% endif %}
</tr>